<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();

	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="copyright" content="" />
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		
		<title>全员营销活动编辑页</title>
		
		<link href="<%=path%>/favicon.ico" rel="shortcut icon">
		<link href="https://cdn.jsdelivr.net/gh/bootcdn/BootCDN/ajax/libs/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
		<link rel="stylesheet" type="text/css" href="<%=path%>/css/marketing/public.css" />
		<link rel="stylesheet" type="text/css" href="<%=path%>/css/marketing/activity.css" />
		<link rel="stylesheet" type="text/css" href="<%=path%>/css/marketing/custom.css" />
		<link rel="stylesheet" type="text/css" href="<%=path%>/css/marketing/style_list.css" />  
		<link rel="stylesheet" type="text/css" href="<%=path%>/css/marketing/marketing.css" />
	
		<link href="<%=path%>/hplus/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
		<link href="<%=path%>/hplus/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
		<link href="<%=path%>/hplus/css/plugins/iCheck/custom.css" rel="stylesheet">
		<link href="<%=path%>/hplus/css/plugins/footable/footable.core.css" rel="stylesheet">
		<link rel="stylesheet" type="text/css" href="<%=path%>/hplus/css/plugins/dataTables/css/jquery.dataTables.min.css" />
		<link href="<%=path%>/hplus/css/animate.min.css" rel="stylesheet">
		<link href="<%=path%>/hplus/css/style.min862f.css?v=4.1.0" rel="stylesheet">
		<link href="<%=path%>/hplus/css/plugins/clockpicker/clockpicker.css" rel="stylesheet">
		<link href="<%=path%>/hplus/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
		<link rel="stylesheet" type="text/css" href="<%=path%>/hplus/js/plugins/sweetalert/sweetalert2.min.css">
		
		<link href="<%=path%>/css/marketing/s_style.css" rel="stylesheet">
		
		
		<style type="text/css">
			body{ 
				font-family: 'Century Schoolbook';
			}
			
			.x_progress{
			    height: 30px;
			    width: 1200px;
			    margin: 1% 0 2%;
			}
			.s_progress_bar{
			    width: 400px;
			    height: 4px;
			    font-size: 12px;
			    color: #fff;
			    text-align: center;
			    float: left;
			}
			.row-div{
				margin-top:50px;
				margin-left:5%
			}
			.row-div-block{
				margin-top:10px;
				margin-left:5%
			}
			.row-hide{
				display:none;
			}
			
			.control-label{
				margin-left:0px;
				float:left;
				width:100px;
				margin-top:25px;
				font-weight:bold;
				font-family: 'Arial Normal', Georgia, 'New York', serif;
			}
			
			.control-label-2{
				margin-left:0px;
				float:left;
				width:80px;
				margin-top:25px;
				font-weight:normal;
				font-family: 'Arial Normal', Georgia, 'New York', serif;
			}
			
			.form-control{
			    background-color: #FFF;
			    background-image: none;
			    border: 1px solid #e5e6e7;
			    border-radius: 3px; 
			    color: inherit;
			    display: block;
			    padding: 6px 12px;
			    -webkit-transition: border-color .15s ease-in-out 0s,box-shadow .15s ease-in-out 0s;
			    transition: border-color .15s ease-in-out 0s,box-shadow .15s ease-in-out 0s;
			    width: 100%;
			    font-size: 14px;
			    margin-top:20px;
		    }
		    
		</style>
		
		<style type="text/css">
			.tishi{
	            margin-top: 7px;
	        }
	
	        .alert{
	            position:absolute;
	            top: -15px;
	            left: 8%; 
	            display:none;
	        }
		</style>
		
	</head>
	<body>
		<div class="wrapper wrapper-content animated fadeInRight">
			<div class="container-fluid">
				<div hidden class="row" style="background-color:white; margin-left:30px ">
					<span >全员营销活动</span> <span>></span>  <span>编辑活动</span> <span>></span>  <span style="color:#1BB394">编辑营销活动</span> 
				</div>
				
				<div hidden class="row" style="background-color:white; margin-left:30px ; margin-top:40px; ">
					<span id="row-div-tip" style="font-size: 16px">创建营销活动</span> 
				</div>

				<div class="row row-div">
					<div class="x_progress">
						<div class="s_line"> 
							<div id="stype-1" class="s_progress_bar s_current"  >
								<span class="sr-only_1">1</span>
								<p class="x_color_bz">创建传播任务</p>
							</div> 
							<div id="stype-2" class="s_progress_bar"  >
								<span class="sr-only_2">2</span>
								<p class="x_color_bz">设置参与人群</p>
							</div> 
							<div id="stype-3" class="s_progress_bar"  >
								<span class="sr-only_2">3</span>
								<p class="x_color_bz">设置奖励规则</p>
							</div> 
						</div>
					</div>
				</div> 
				
				<!-- 创建营销活动 -->
				<div id="aem-div" class="row row-div-block">
					<form id="aem" action="javascript:void(0)" style="width:450px">
						<table > 
						  	<tr>
							    <td>
							    	<label class="control-label"><span style="color:red">* </span>任务名称：</label>
						    	</td>
							    <td style="width:350px">
							    	<input id="aem-id" type="hidden" name="id" value=""> 
							    	<input id="aem-name" name="name" type="text" class="form-control" maxlength="64"  >
							    	<input id="aem-name-old" name="oldName" type="hidden" >
						    	</td>
						  	</tr>
						  	<tr>
							    <td>
							    	<label class="control-label"><span>&nbsp&nbsp&nbsp</span>任务类型：</label>
						    	</td>
							    <td style="width:350px">
							    	<select id="aem-type-id" name="aemTypeId" class="form-control" style="">
					              		<!-- TODO 等待异步填充数据 -->
									</select>
							    </td>
						  	</tr>
						  	
						  	<tr>
							    <td>
							    	<label class="control-label"><span style="color:red">* </span>任务时间：</label>
						    	</td>
							    <td style="width:350px"> 
						           <div class="input-daterange input-group" id="datepicker" style="">
				                        <input id="start-time" name="startTime" type="text" class="input-sm form-control" style="background-color: white;" value="" readonly="readonly">
				                        <span class="input-group-addon" style="padding:0px;background-color:#FFFFFF; border:0px;padding-top:15px;padding-left:5px;padding-right:5px;">至</span>
				                        <input id="end-time" name="endTime" type="text" class="input-sm form-control" style="background-color: white;" value="" readonly="readonly">
				                    </div>
						    	</td>
						  	</tr>
						  	
						  	<!-- <tr>               
							    <td>
							    	<label class="control-label"><span style="color:red">* </span>活动内容：</label>
						    	</td>
							    <td style="width:350px">
							    	<table >
							    		<tr>
							    			<td style="width:90px">
										    	<button type="button" class="btn btn-primary" onclick="" style="margin-top:20px;">选择H5素材</button> 
									    	</td>
									    	<td>
									    		<span style="display: inline-block;margin-top:20px;margin-left:5px;font-size:8px;">选择已有的H5图文或</span>
									    		<a style="display: inline-block;margin-top:20px;">创建新的H5素材</a> 
									    	</td>
							    		</tr>
							    	</table>
						    	</td>
						  	</tr> -->
						  	<tr>
							    <td>
							    	<label class="control-label"><span style="color:red">* </span>任务内容：</label>
						    	</td>
							    <td style="width:350px">
							    	<div id="h5-aem-info" style="margin-top:20px;"> 
							    		<!-- <input type="hidden" name="mgiId" value="1">  -->
							    		<span id="mgi-name" style="border: 1px #F19736 solid;padding:2px;border-radius: 3px;"></span>
							    		<!-- <img class="x_lista"  src="/scrm_sps/images/marketing/close.png" onclick="aemInfoOperate.deleteH5(this)"> -->
							    	</div>
						    	</td>
						  	</tr>
						  	
						  	<!-- 添加一个空白行作为间距填充 -->
						  	<tr>
							    <td><label class="control-label"></label></td>
							    <td style="width:350px"></td>
						  	</tr>
						  	
						  	<tr>
							    <td>
							    	<label class="control-label"><span style="color:red">* </span>任务图片：</label>
						    	</td>
							    <td style="width:350px">
	                                <form enctype='multipart/form-data'>
	                                    <ul>
	                                        <li>
	                                            <div class="x_pt_h" > 
	                                                <div class="x_img_sc" style="width: 690px;height: 260px;">
	                                                	<img id="card_image" name="pic"  src="<%=path%>/images/marketing/img_p.png" height="100%" width="100%">
                                                		<input type="hidden" id="pic" name="pic" value="">  
                                                	</div>
	                                                <input type="file" onchange="uploadPic()" accept="image/gif,image/jpeg,image/x-png" id="x_inputfile" name="filepath" style=" filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0.5; opacity: 0.0; position:absolute; z-index:99;width: 690px;height: 260px;"">
	                                            </div>
                                               	<div style="color:#676a6c">请上传 ＜3M 的图片  建议尺寸690*260</div>
	                                        </li>
	                                    </ul>
	                                </form>
						    	</td>
						  	</tr>
						  	
						  	<tr>
							    <td><label class="control-label"></label></td>
							    <td style="width:350px">
							    	<button type="button" class="btn btn-primary" onclick="aemInfoOperate.aemDivNext()" style="margin-top:20px;">下一步</button> 
							    </td>
						  	</tr>
						</table>
					</form>
				</div>
				
				<!-- 设置参与人群 -->
				<div id="participation-div" class="row row-div-block row-hide">	
					<label style="color:red; font-weight: normal;">注意：员工只可通过领取任务进行传播获取积分，相互间分享不会相互奖励积分</label>
					<form id="participation" action="javascript:void(0)" style="width:450px">
						<table > 
						  	<tr> 
							    <!-- <td>
							    	<label class="control-label"><span>&nbsp&nbsp&nbsp</span>员工首发：</label>
						    	</td>
							    <td style="width:350px">
							    	<input id="" name="isStaffFirst" type="radio"  value="1" style="vertical-align:middle;margin-top:20px;" checked> 
							    	<span style="vertical-align:middle;display:inline-block;margin-top:20px;" >是</span>
							    	<input id="" name="isStaffFirst" type="radio"  value="0" style="vertical-align:middle;margin-top:20px;" > 
							    	<span style="vertical-align:middle;display:inline-block;margin-top:20px;" >否</span>
						    	</td>
						    	<td>
						    		<div class="tishi col-sm-6" style="position:relative;margin-left:15px;margin-top:22px">
				                        <img src="../../images/marketing/help.png">
				                        <div class="col-sm-4 alert alert-success" style="display: none;margin-left:45px;width:400px">
				                            	设置是否将所有员工都作为始发者来分享活动，员工始发即员工与员工之间点击、转发，不互相增加积分。
				                        </div>
				                    </div>
						    	</td> -->
						  	</tr>
						  	
						  	<!-- 添加一个空白行作为间距填充 -->
						  	<tr>
							    <td><label class="control-label"></label></td>
							    <td style="width:350px" colspan="2"></td>
						  	</tr>
						  	
						  	<tr>
							    <td>
							    	<label class="control-label"><span style="color:red">* </span>发布部门：</label>
						    	</td>
							    <td style="width:350px">
							    	<div class="ibox-content s_ibox_content" id="ztreediv" style="min-width:98px;  height:200px; overflow:auto; overflow-x:hidden;" >		
	                                	<div style="overflow-x:auto;">
		                                	<!-- 引入zTree -->		
		                                    <ul id="tree" class="ztree" ></ul>   
	                                    </div>  
	                                </div>
						    	</td>
						    	<td>
						    		<div class="tishi col-sm-6" style="position:relative;margin-left:15px;margin-top:22px">
				                        <img src="../../images/marketing/help.png">
				                        <div class="col-sm-4 alert alert-success" style="display: none;margin-left:45px;width:400px">
				                            	只有勾选身份的用户可以获得积分
				                        </div>
				                    </div>
						    	</td>
						  	</tr>
						  	
						  	<tr>
							    <td>
							    	<button type="button" class="btn btn-primary" onclick="aemInfoOperate.participationDivBack()" style="margin-top:20px;">上一步</button>
							    </td>
							    <td style="width:350px">
							    	<button type="button" class="btn btn-primary" onclick="aemInfoOperate.participationDivNext()" style="margin-top:20px;">下一步</button> 
							    </td>
						  	</tr>
						</table>
					</form>
				</div>
				
				<!-- 设置奖励规则 -->
				<div id="reward-div" class="row row-div-block row-hide">	
					<form id="reward" action="javascript:void(0)" style="width:850px">
						<table > 
						  	<tr>
							    <td style="width:90px">
							    	<label class="control-label"><span style="color:red">* </span>分享层级：</label>
						    	</td>
							    <td> 
							    	<select id="aem-level" name="countShareLevel" class="form-control" style="width:200px">
							    		<option value="">请选择分享层级</option>
										<option value="1">1</option>
										<option value="2">2</option>
										<option value="3">3</option>
										<option value="4">4</option>
										<option value="5">5</option> 
									</select>
						    	</td>
						    	<td>
						    		<div class="tishi col-sm-6" style="position:relative;margin-left:15px;margin-top:22px">
				                        <img src="../../images/marketing/help.png">
				                        <div class="col-sm-4 alert alert-success" style="display: none;margin-left:45px;width:400px">
				                            	根据设置的层级进行积分统计，并将积分计入给该节点的第一层级用户，即始发者。
				                        </div>
				                    </div>
						    	</td>
						  	</tr>
						  	
						  	<tr>
							    <td style="width:90px">
							    	<label class="control-label"><span style="color:red">* </span>奖励规则：</label>
						    	</td>
							    <td style="width:200px">
							    	<table >
							    		<tr>
							    			<td style="width:90px">
										    	<label class="control-label-2">分享积分</label>
									    	</td>
									    	<td>
										    	<input id="share-score" name="shareScore" type="text" class="form-control" maxlength="10" style="float:left;width:90px;" placeholder="正整数">
									    	</td>
							    		</tr>
							    	</table> 
						    	</td>
						    	<td>
						    		<label class="control-label" style="width:360px">分享给好友即获得积分，好友完成分享再获得积分</label>
					    		</td>
						  	</tr>
						  	<tr>
							    <td style="width:90px">
							    	<label class="control-label"></label>
						    	</td>
							    <td style="width:200px">
							    	<table >
							    		<tr>
							    			<td style="width:90px">
										    	<label class="control-label-2">点击积分</label>
									    	</td>
									    	<td>
										    	<input id="click-sore" name="clickSore" type="text" class="form-control" maxlength="10" style="float:left;width:90px;" placeholder="正整数">
									    	</td>
							    		</tr>
							    	</table>
						    	</td>
						    	<td>
						    		<label class="control-label" style="width:260px">分享给好友，好友点击可获得积分</label>
					    		</td>
						  	</tr>
						  	<tr>
							    <td style="width:90px">
							    	<label class="control-label"><span style="color:red">* </span>奖励说明：</label>
						    	</td>
							    <td style="width:200px">
							    	<table >
							    		<tr>
									    	<td>
										    	<textarea id="share-note" name="bonusNote" type="text" class="form-control" maxlength="50" style="float:left;width:200px;" placeholder="备注"></textarea>
									    	</td>
							    		</tr>
							    	</table> 
						    	</td>
						  	</tr>
						  	<tr>
							    <td colspan="3"> 
							    	<img src="<%=path%>/images/aem/888723435058542.png" height="198px" width="504px"  style="margin-top:100px">
							    </td> 
						  	</tr>
						  	<%-- <tr>
						  		<td> 
						  			<img src="../../images/marketing/help.png">
						  		</td>
						  		<td>
						  			<div>活动通知《<a style="text-decoration:underline;" href="<%=path %>/aemInfo/ajaxDownloadHelpWord">开通流程</a>》</div>
						  		</td>
						  	</tr> --%>
						  	<tr>
							    <td>
							    	<button type="button" class="btn btn-primary" onclick="aemInfoOperate.rewardDivBack()" style="margin-top:20px;">上一步</button>
							    </td>
							    <td style="width:350px" colspan="2">
							    	<button id="edit-btn" type="button" class="btn btn-primary" atype="edit" onclick="aemInfoOperate.rewardDivSubmit(this)" style="margin-top:20px;">完成</button> 
							    </td>
						  	</tr>
						</table>
					</form>
				</div>
	
			</div>
		</div><!-- wrapper end -->
		
		
		<div id="selectuser" class="row m-b-lg x_selectuser">
		    <div class="col-sm-12 issue_selectuser" style="height: 635px">
		        <div class="row" style="margin-left: -30px;margin-bottom: 20px;">
		            <div class="col-sm-5">
		                <div class="input-group">
		                    <input placeholder="输入名称进行搜索" class="form-control" type="text" > 
		                    <span class="input-group-btn">
		                    	<button class="btn btn-primary" type="button" onclick="dialogPage.search()">搜索</button>
	                    	</span>
		                </div>
		            </div>
		        </div>
		        
		        <div class="row" >
		        	<table>
		        		<thead>
		        			<tr>
		        				<th>选择</th>
		        				<th>H5名称</th>
		        				<th>有效期</th>
		        			</tr>
		        		</thead>
		        		<tbody id="page-list">
		        			<!-- 填充列表数据信息 -->
		        		</tbody>
		        	</table>
		        </div>
		        
		        <div class="m_xpages" style="padding: 0;">
		            <div id="table-footer" class="mian">
						<!-- TODO 等待填充 -->		           
		            </div>
		        </div>
		        <div class="col-sm-12 text-center" style="margin-top:10px;">
		            <button class="btn btn-w-m btn-primary" type="button">确认</button>
		            	&nbsp;&nbsp;&nbsp;&nbsp;
		            <button class="btn btn-w-m btn-white" type="button" onclick="dialogPage.closeDialog()">取消</button>
		        </div>
		    </div>
		</div>
		
	</body>
</html>


<script src="<%=path%>/hplus/js/jquery.min.js?v=2.1.4"></script>
<script type="text/javascript" src="<%=path%>/hplus/js/plugins/dataTables/jquery.dataTables.min.js"></script>

<script src="<%=path%>/hplus/js/bootstrap.min.js?v=3.3.6"></script>
<script src="<%=path%>/hplus/js/plugins/chosen/chosen.jquery.js"></script>
<script src="<%=path%>/hplus/js/plugins/jsKnob/jquery.knob.js"></script>
<script src="<%=path%>/hplus/js/plugins/jasny/jasny-bootstrap.min.js"></script>
<script src="<%=path%>/hplus/js/plugins/datapicker/bootstrap-datepicker.js"></script>
<script src="<%=path%>/hplus/js/plugins/prettyfile/bootstrap-prettyfile.js"></script>
<script src="<%=path%>/hplus/js/plugins/switchery/switchery.js"></script>
<script src="<%=path%>/hplus/js/plugins/ionRangeSlider/ion.rangeSlider.min.js"></script>
<script src="<%=path%>/hplus/js/plugins/iCheck/icheck.min.js"></script>
<script src="<%=path%>/hplus/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="<%=path%>/hplus/js/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
<script src="<%=path%>/hplus/js/plugins/clockpicker/clockpicker.js"></script>
<script src="<%=path%>/hplus/js/plugins/cropper/cropper.min.js"></script>
<script src="<%=path%>/hplus/js/demo/form-advanced-demo.min.js"></script>
<script src="<%=path%>/hplus/js/plugins/suggest/bootstrap-suggest.min.js"></script>
<script src="<%=path%>/hplus/js/plugins/sweetalert/sweetalert2.min.js"></script>
<script type="text/javascript" src="<%=path%>/js/marketing/dialog.js"></script>
<script type="text/javascript" src="<%=path%>/js/marketing/public.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>

<%-- <script type="text/javascript" src="<%=path%>/hplus/js/plugins/datapicker/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="<%=path%>/hplus/js/plugins/datapicker/bootstrap-datetimepicker.zh-CN.js"></script>
 --%>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.form/4.2.2/jquery.form.js"></script>
<link href="<%=path%>/hplus/css/plugins/zTree/zTreeStyle/metro.css" rel="stylesheet">
<script src="<%=path%>/hplus/js/plugins/zTree/jquery.ztree.all-3.5.min.js"></script>	

<!-- 全员营销活动 - 主脚本 -->
<script type="text/javascript" src="<%=path%>/js/aem/aem-info-operate.js"></script> 
<!-- 页面上所展示的树 -->
<script type="text/javascript" src="<%=path%>/js/aem/aem-info-org-tree.js"></script>

<script type="text/javascript">
	$(function(){
		// 开始回显编辑页面信息
		aemInfoOperate.init('${status}').drawEditPage('${aemInfoId}');
		
		$('.tishi img').mouseover(function(){
            $(this).parent().find('.alert').show();
        });
        $('.tishi img').mouseout(function(){
            $(this).parent().find('.alert').hide();
        });
        
        if('${status}' != '3'){
        	$('#start-time').datepicker({  
                todayBtn : "linked",  
                autoclose : true,  
                todayHighlight : true, 
                forceParse : true,
                startDate : new Date()  
            }).on('changeDate',function(e){  
            });
        	$('#end-time').datepicker({  
                todayBtn : "linked",  
                autoclose : true,  
                todayHighlight : true, 
                forceParse : true,
                startDate : new Date()  
            }).on('changeDate',function(e){  
            });
        }
        
		//初始化部门基础树、新建部门树、编辑部门树、
    	initZtree();
	});
	
    function uploadPic(){ 
        $("#aem").submit(function(event){
            $("#aem").ajaxSubmit({
                type: "post",
                url: "${pageContext.request.contextPath}/api/uploadfile/file",
                data:{"typename":"filepath"},
                success: function (e) {
                    var head_pic = e.realSavePath;
                    if(StringEmpty(head_pic)){
                        var tutu = $('#card_image').attr('src',e.realSavePath);
                        $("#pic").val(e.realSavePath);
                        var pian = $('#head_pic').attr('src',e.realSavePath);
                    }

                },
                error: function (msg) {
                    promptDialog("文件上传失败");
                }
            });
            return false;
        });
        $("#aem").submit();
    }
    
  	//初始化部门基础树			
	function initZtree(){
    	//保存所有的部门节点数据
    	var zNodes =[];
		//发送ajax请求，从DB中查询该企业下，包含层级关系的全部部门
      	var url="<%=path%>/department/ajaxSelectAllDepartment";
    	$.post(url, {
		}, function(data) {
			var realData = data.data;
			if (data.status == 200) {
				for(var i=0;i<realData.length;i++){
					var treeData = null;
					//机构团队用不同的图标
					if(realData[i].companyType == 1){
					   var name = realData[i].name;
					   if(name.length > 8){
						   name = name.substring(0,8) + "...";
					   }
					   var userNum = realData[i].title.split(",")[3];
					   if(userNum > 0){
						   treeData = {id:realData[i].id,companyType:realData[i].companyType,leaderName:realData[i].leaderName,pId:realData[i].parentDeptId, name:name,font:{'font-weight':'bold'},title:realData[i].name+","+realData[i].title+","+"${pageContext.request.contextPath}/images/system/mechanismIcon.png",open:true,icon:"${pageContext.request.contextPath}/images/system/mechanismIcon.png"};  
					   }else{
						   treeData = {id:realData[i].id,companyType:realData[i].companyType,leaderName:realData[i].leaderName,pId:realData[i].parentDeptId, name:name,font:{'color':'#BBBBBB'},title:realData[i].name+","+realData[i].title+","+"${pageContext.request.contextPath}/images/system/mechanismIcon.png",open:true,icon:"${pageContext.request.contextPath}/images/system/mechanismIcon.png"};
					   }
					   
					}else{
 					  var name = realData[i].name;					
					  if(name.length > 8){
						  name = name.substring(0,8) + "...";
					  }
					  var userNum = realData[i].title.split(",")[3];
					  if(userNum > 0){
					       treeData = {id:realData[i].id,companyType:realData[i].companyType,leaderName:realData[i].leaderName,pId:realData[i].parentDeptId, name:name,font:{'font-weight':'bold'},title:realData[i].name+","+realData[i].title+","+"${pageContext.request.contextPath}/images/system/teamIcon.png",open:true,icon:"${pageContext.request.contextPath}/images/system/teamIcon.png"};
					  }else{
					       treeData = {id:realData[i].id,companyType:realData[i].companyType,leaderName:realData[i].leaderName,pId:realData[i].parentDeptId, name:name,font:{'color':'#BBBBBB'},title:realData[i].name+","+realData[i].title+","+"${pageContext.request.contextPath}/images/system/teamIcon.png",open:true,icon:"${pageContext.request.contextPath}/images/system/teamIcon.png"};	  
					  }
					}
					zNodes.push(treeData);
				}
				zTree(zNodes , '${status}' == '1');
			}else{		
        		errorDialog(data.message);
        	}
		}); 
	}
  	
</script>






























